import React, { Component } from 'react'

export default class LifeSon extends Component {

    constructor() {
        super()

        this.timer = setInterval(() => {
            console.log('子组件:', Date.now())
        }, 1000)


    }

    componentDidMount () { }


    componentWillReceiveProps () {
        console.log('  子组件的 componentWillReceiveProps')
    }
    shouldComponentUpdate () {
        console.log('  子组件的 shouldComponentUpdate')
        return true
    }
    componentDidUpdate () {
        console.log('子组件的 componentDidUpdate')
    }
    componentWillUnmount () {
        console.log('子组件销毁  componentWillUnmount')

        clearInterval(this.timer)
    }


    render () {

        console.log(' 子组件的 render')
        return (
            <>
                <div>LifeSon</div>
                {this.props.num}
            </>

        )
    }
}
